﻿using Castle.DynamicProxy;
using System.Reflection;
namespace LogForParameter.Api
{
    /// <summary>
    /// 代理既基于拦截器控制服务
    /// </summary>
    public class GenerDecorator : DispatchProxy,IInterceptor
    {
        public object TargetClass { get; set; }

        public void Intercept(IInvocation invocation)
        {
            invocation.Proceed();
        }
        protected override object Invoke(MethodInfo targetMethod, object[] args)
        {
            targetMethod.Invoke(TargetClass, args);
            return "";
        }
    }
}